Occupancy sensors programmed to determine loss of lamp life as lamp is used

ABSTRACT

Programmable occupancy sensors that control the on/off operation of a fluorescent lamp automatically determine loss of lamp life as the lamp is used. The programmable occupancy sensors can provide lamp life status and can automatically alert a user when a lamp is nearing its end of life and should be replaced. The occupancy sensors are also programmable to automatically maximize lamp life and energy savings by selecting an optimal time delay from among a number of selectable time delays at which to operate the sensor. The selection is based on an occupancy pattern sensed by the sensor over a given period of time. The optimal time delay, which prevents the lamp from turning off immediately after last sensing occupancy, extends lamp life by limiting the number of lamp off/on transitions, which shortens lamp life, in view of overall energy usage and lamp usage.

FIELD OF THE INVENTION

The invention relates to occupancy sensors. More particularly, theinvention relates to occupancy sensors programmed to automaticallydetermine loss of lamp life as a fluorescent lamp controlled by theoccupancy sensor is used.

BACKGROUND OF THE INVENTION

Lamps typically are replaced either according to a pre-determinedschedule or after they burn out. The pre-determined schedule is usuallya rough estimate of when lamps will be near their end of life based onthe lamp's published lamp life (defined in hours of operation) and thelamp's expected usage. Neither replacement method is particularlydesirable. Replacing lamps according to a schedule may unnecessarilyincrease lamp replacement costs and environmental waste if the replacedlamps still have many hours of lamp life remaining. Replacing lampsafter they burn out causes at least some inconvenience and may result inhazardous or dangerous conditions until the lamps are replaced.Unfortunately, nothing is currently known that can automatically alert auser to a lamp's pending end of life based on actual usage of the lamp.

Occupancy sensors automatically control the operation of lights and areused to save energy and lamp life by turning off lights in areas thatare unoccupied. When the presence of one or more persons is detected bythe occupancy sensor, the sensor turns on or keeps on the lightscontrolled by the sensor. However, the lamp life of a fluorescent lampdecreases as the number of starts (i.e., off/on transitions) increases.That is, each off/on transition reduces the lamp's operating hours by asmall amount. Thus, if lights are turned off and then back on againafter too short a period of off time, more lamp life is lost by theaffect of the lights turning back on than is saved by the short offtime.

To help prevent lights from unnecessarily turning off and on toofrequently, occupancy sensors typically have a short time delay thatkeeps lights on after occupancy is last detected. Should an occupantreturn within the time delay, the lights will remain on, thus avoidingan off/on transition. However, this feature may not extend lamp life ifthe actual occupancy pattern does not conform to the time delay. Forexample, if occupants tend to leave and return just after expiration ofthe sensor's time delay, no off/on transitions are avoided and loss oflamp life is accelerated.

This time delay is programmable in some known occupancy sensors.However, nothing is currently known that can automatically select theoptimal time delay based on actual occupancy patterns. Thus, a user islikely to select a time delay based on a predicted occupancy pattern,which may or may not result in any lamp life savings.

In view of the foregoing, it would be desirable to be able to provide anoccupancy sensor that can be programmed to monitor and report lamp lifestatus to a user.

It would also be desirable to be able to provide an occupancy sensorthat can automatically select the optimal time delay based on an actualoccupancy pattern detected by the sensor.

SUMMARY OF THE INVENTION

In accordance with the invention, a programmable occupancy sensorautomatically determines loss of lamp life of a fluorescent lamp as thelamp is being used. An algorithm implemented in software or firmware andexecuting on preferably the sensor's microcontroller calculates lamploss taking into account the fluorescent lamp's actual hours ofoperation (i.e., actual on time) and the number of off/on transitions.In one embodiment of the invention, the sensor can communicate to a userlamp life status (e.g., the percentage of lamp life remaining or used)and can alert a user when a lamp is nearing its end of life and shouldbe replaced via a programmable push button and one or more LEDs (lightemitting diodes) located on the sensor. In another embodiment of theinvention, a networked occupancy sensor coupled to a display deviceeither directly or through a lighting control system can provide a userwith the same and more detailed lamp life information via graphicaldisplays and optional audible alerts. Occupancy sensors of the inventioncan advantageously avoid the inconvenience or dangerous and/or hazardousconditions caused by burnt out lamps without wasting any lamps that maystill have useful lamp life remaining.

Occupancy sensors of the invention also can be programmed to maximizelamp life and energy savings by automatically determining and selectingthe optimal time delay from among a number of selectable time delaysavailable in the sensor. The sensor tracks each off/on transition andthe total on time of the lamp for the time delay currently programmed inthe sensor based on actual occupancy patterns sensed by the sensor overa given test period (e.g., two weeks). The sensor can also concurrentlysimulate the effects of the remaining selectable time delays on lamplife and energy savings based on the same occupancy patterns sensed bythe sensor over the given test period. Using the lamp loss algorithmmentioned above, the sensor calculates the loss of lamp life for each ofthe time delays and then, in one embodiment, automatically programs thesensor to operate with the time delay having the lowest loss of lamplife. The sensor can be further programmed to continue calculating lamploss for each of the selectable time delays over consecutive testperiods. After each test period, the sensor can be automaticallyreprogrammed with a newly determined optimal time delay should, forexample, sensed occupancy patterns change.

Occupancy sensors of the invention can therefore be advantageously usedto save energy and extend fluorescent lamp life automatically by turningoff lamps when not needed, by reducing off/on transitions with anoptimal time delay based on observed occupancy patterns, and bycontinuously monitoring occupancy patterns to ensure that the sensor isalways operating with an optimal time delay.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other advantages of the invention will be apparent uponconsideration of the following detailed description, taken inconjunction with the accompanying drawings, in which like referencecharacters refer to like parts throughout, and in which:

FIG. 1 is a simplified block diagram illustrating an occupancy sensorcontrolling fluorescent lighting according to the invention;

FIG. 2 is a block diagram of an exemplary embodiment of an occupancysensor according to the invention;

FIG. 3 is a simplified block diagram illustrating another embodiment ofan occupancy sensor controlling fluorescent lighting according to theinvention;

FIG. 4 is a known graph of lamp life versus minutes-on per start for acommon fluorescent lamp;

FIG. 5 is a flowchart of an exemplary embodiment of an algorithm fordetermining an optimal time delay for an occupancy sensor according tothe invention;

FIG. 6 illustrates the temporal relationships between actual andsimulated occupancy sensor time delays on lamp operation according tothe invention;

FIG. 7 is a graph of lamp loss versus time delay determined by thealgorithm of FIG. 5 for a first occupancy pattern according to theinvention;

FIG. 8 is a graph of lamp life and calendar life versus time delay forthe first occupancy pattern according to the invention;

FIG. 9 is a graph of lamp loss versus time delay determined by thealgorithm of FIG. 5 for a second occupancy pattern according to theinvention;

FIG. 10 is a graph of lamp life and calendar life versus time delay forthe second occupancy pattern according to the invention;

FIG. 11 is a simplified block diagram of a lighting control systemaccording to the invention;

FIG. 12 is a block diagram of an exemplary embodiment of a networkedoccupancy sensor that can be used in the system of FIG. 11 according tothe invention;

FIG. 13 is a block diagram of an exemplary embodiment of a gatewayaccording to the invention; and

FIG. 14 illustrates an exemplary embodiment of a screen display fordisplaying lamp life status according to the invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 shows a lighting control zone 100 that includes an occupancysensor 102 coupled to four fluorescent lighting units 104, eachcontaining two fluorescent lamps 106. Note that the number of lightingunits coupled to sensor 102 and the number of fluorescent lamps 106 perlighting unit is merely illustrative and can be more or less than thatshown. A lighting control zone may be, for example, an individual roomor office, a classroom, a manufacturing area, a lobby, or other definedarea whose lighting is controlled by an occupancy sensor. In thisembodiment, occupancy sensor 102 is a ceiling mounted 360° sensortypically placed in private offices, vestibules, or small rooms. Sensor102 is a line voltage sensor and has an integrated relay connected topower via Class 1 wiring 105 and to fluorescent lighting units 104 viaClass 1 wiring 103. Sensor 102 also has an integrated microcontrollerand firmware, and the ability to operate with preferably passiveinfrared (PIR) detection technology or both PIR and sound detectiontechnology.

Occupancy sensor 102 controls the on/off operation of fluorescent lamps106 based on detected occupancy. When sensor 102 senses the presence ofone or more persons, the sensor generates one or more signals that causethe relay switch of the integrated relay to close. The closed relayswitch connects power to the lighting units, which turns on the lamps.When occupancy is no longer sensed, a “last detected occupancy” timeractivates. This timer is programmed to a selectable time delay thatallows for short periods of vacancy or undetected occupancy without thelights turning off (such as, for example, when an occupant ismomentarily motionless or momentarily leaves the lighting control zoneand returns). The movement or return of the occupant resets the timer.Upon expiration of the time delay, the sensor generates one or moresignals that cause the relay switch to open (these signals are typicallyof opposite logic level or polarity than the previously generatedoccupancy signals). The open relay switch disconnects power from thelighting units, which turns off the lamps. Occupancy sensors thus saveenergy by automatically turning off lights when not needed.

FIG. 2 shows a hardware embodiment of occupancy sensor 102 in accordancewith the invention. Occupancy sensor 102 includes integratedmicrocontroller 210, PIR detector 211, optional sound detector(microphone) 212, optional daylight detector (photocell) 213,programmable push button 214, LED 220, H-bridge #1, optional H-bridge#2, relay #1, optional relay #2, and optional dimming outputs #1 and #2(for use with dimmable lighting ballasts and daylight detector 213).Occupancy sensor 102 can be programmed to operate with either PIRdetection or both PIR and sound detection for rooms or areas that mayhave obstructions. (The PIR and sound detection technology may be thesame as that disclosed in, for example, U.S. Pat. No. 5,701,117, whichis hereby incorporated by reference). The H-bridges allow the sensors tothrow the relays in either direction. That is, the H-bridges arecircuits that allow current to pass in either direction (i.e., eitherpolarity) through the relay coil to allow the rely to switch in eitherdirection. Microcontroller 210, which is operative to execute softwareand/or firmware, is preferably a Texas Instruments MSP430F1132, andpreferably includes one or more counters and registers and canfunctionally implement various timers.

The invention can include other types of occupancy sensors withdifferent sensing capabilities in order to provide occupancy detectionfor rooms and areas having a wide variety of characteristics andconfigurations. The different types of sensors include ceiling mountedextended range 360° sensors for placement in large rooms or areas; highbay 360° sensors for placement in areas with high ceilings such aswarehouses and gymnasiums; corner or ceiling mounted wide view sensorsfor placement in areas such as classrooms; and wall or ceiling mountedhallway sensors for placement in long narrow areas such as hallways orcorridors. U.S. Pat. Nos. 6,215,398 and 6,304,180 each discloseoccupancy sensing technologies that may be used in the occupancy sensorsof the invention and are thus hereby incorporated by reference. Alloccupancy sensors of the invention have integrated microcontrollers andfirmware. Occupancy sensors of the invention may be connected to otherdevices such as power packs/supplies, wall units, and daylight sensors,and multiple occupancy sensors may be used in the same lighting controlzone to provide coverage for oddly shaped rooms or large open areas.

Note that the various embodiments of occupancy sensors that can be usedwith the invention may not have all of the sensing and output componentsshown in FIG. 2. For example, some sensors may not have relays (asdescribed below in conjunction with FIG. 3) or only one relay. Othersensors may not have dimming outputs or only one dimming output. Whilestill other sensors may not have daylight detector (photocell) 213, PIRdetector 211, or sound detector (microphone) 212.

Occupancy sensors of the invention may operate with low voltage insteadof line voltage (sensor 102 operates with line voltage). Low voltagesensors do not have a relay and thus communicate with relays locatedelsewhere within the lighting control zone. FIG. 3 shows a lightingcontrol zone 300 that includes a low voltage occupancy sensor 302coupled to a power supply/relay 301 via low voltage white wire 307.Power supply/relay 301 is coupled to power via Class 1 wiring 305 and tofour fluorescent lighting units 304 via Class 1 wiring 303. Eachlighting unit 304 contains two fluorescent lamps 306. Note again thatthe number of lighting units coupled to power/supply relay 301 and thenumber of fluorescent lamps 306 per lighting unit is merely illustrativeand can be more or less than that shown. Note also that powersupply/relay 301 may be coupled to other low voltage occupancy sensors(not shown) in control zone 300. Sensor 302 includes at least amicrocontroller, a preferably PIR detector (e.g., PIR detector 211), aprogrammable push button (e.g., push button 214), an LED (e.g., LED220), and a white wire signal driver. Sensor 302 receives power frompower supply/relay 301 via a low voltage connection and communicatesoccupancy information to power supply/relay 301 via white wire 307. Thatis, when occupancy is detected by sensor 302 (or any other sensorcoupled to power supply/relay 301 via white wire 307), sensor 302 drivesthe white wire typically high (unless negative logic signaling is used),which causes power supply/relay 301 to close its relay switch. Theclosed relay switch connects power to the lighting units, which turns onthe lamps. Other devices coupled to the white wire can sense the stateof the white wire (and thus occupancy) and accordingly perform otherassociated processes (e.g., enable optional sound detectors). Theremaining functionality of occupancy sensor 302, and in particularoperation of a “last detected occupancy” timer, is identical or at leastsubstantially identical to occupancy sensor 102.

In other embodiments of the invention, daylight sensing can be usedjointly with occupancy sensing to achieve even greater energy savings.Daylight sensing may be provided by a separate daylight sensor, or theoccupancy sensor may have built in daylight sensing capability such asprovided by optional daylight detector (photocell) 213. Lighting controldecisions may be made using occupancy as the primary factor and daylightas the secondary factor as follows:

Occupancy detected and insufficient daylight: lights on; Occupancydetected and sufficient daylight: lights off; No occupancy detected andinsufficient daylight: lights off; and No occupancy detected andsufficient daylight: lights off;

Fluorescent lamps, which are commonly used in many types of commercial,institutional, and industrial buildings, are gas-discharge lamps thatuse electricity to excite mercury vapor. The excited mercury atomsproduce short-wave ultraviolet light that causes a phosphor tofluoresce, producing visible light. Fluorescent lamps require a ballastto regulate the flow of electrical power through the lamp. Although theinitial cost of fluorescent lamps is higher than that of incandescentlamps, fluorescent lamps convert electrical power into useful light moreefficiently, and thus operate at lower energy costs than incandescentlamps.

The lamp life of a fluorescent lamp, usually expressed in terms ofoperating hours is affected predominately by three operating factors.The first is the amount of time the lamp is actually on, which isdependent on the structural integrity of the lamp's tungsten coil and onthe electron-emissive coating of the lamp's filament. Theelectron-emissive coating evaporates while the lamp is on. The secondfactor is the number of times a lamp is turned on. Each off/ontransition causes a quantity of the coating to be dislodged from thecathode. The third factor is the minimum time the lamp is left on.Fluorescent lamps require the presence of a certain amount of freebarium in order to have ignitions that do not damage the tungsten coil.Free barium is released from the emitter material of the lamp while thelamp is on. If a lamp is not on long enough after each off/ontransition, enough free barium is not released and thus will not bepresent for the next ignition. The tungsten coil is then in danger ofcracking or breaking, which will cause the lamp to fail.

The manner in which the lamp is operated determines which of the threefactors is predominate. If a lamp is turned off and on very infrequently(long on times/start), the amount of time the lamp is on becomes thepredominate lamp loss factor. If the lamp is turned off and on morefrequently (short on times/start), the number of off/on transitionsbecomes the predominate lamp loss factor. And if the lamp is turned onand off below the threshold for allowing enough free barium to bereleased, increasing the likelihood of damage to the tungsten coil, theshort on times become the predominate lamp loss factor.

Fluorescent lamp manufacturers publish “lamp life versus minutes/start”graphs that account for the above lamp loss factors. The graph is a plotof lamp operating hours versus minutes that the lamp is on after eachstart (off/on transition). FIG. 4 shows such a graph for a common T8fluorescent lamp. Note that the longer the lamp is on after each off/ontransition, the higher the lamp's operating hours. Conversely, theshorter the lamp is on after each off/on transition, the lower thelamp's operating hours. Compare the T8's lamp life of 30,000 hours whenleft on for 700 minutes (about 11.7 hours) after each off/on transitionversus a lamp life of only 5,000 hours when left on for only 15 minutesafter each off/on transition. Lamp life significantly decreases as thefrequency of off/on switching increases. In other words, turningfluorescent lamps off and on excessively, dramatically shortens lamplife either from the off/on transitions themselves and/or damage to thetungsten coil.

To substantially eliminate the possibility of the tungsten coil crackingor breaking because of an insufficient amount of free barium, occupancysensors of the invention have a user programmable “required on-timedelay” setting. A “lamp on time” timer implemented in the firmware ofthe microcontroller in the sensor tracks how long the lamp is on andresets whenever the lamp is turned off. The “required on-time delay”setting prevents the sensor from turning off the lamp until the value ofthe “lamp on time” timer meets this setting regardless of occupancy. The“required on-time delay” is separate from, and overrides the sensor'sprogrammable “last detected occupancy” time delay when both delays areactive concurrently. (Recall that the “last detected occupancy” timedelay allows for short periods of vacancy and undetected occupancywithout the lights turning off). Both delays may be active concurrentlywhen, for example, a person enters a room causing the lamps to turn onand then leaves the room a few moments later. The “required on-timedelay” will force the lamps to stay on beyond the expiration of the“last detected occupancy” time delay if the “required on-time delay” islonger by at least those few moments of detected occupancy. The requiredon-time delay forces the lamp to stay on long enough after each off/ontransition to ensure that enough free barium is released for the nextoff/on transition, thus avoiding damage to the tungsten coil andpremature lamp failure. The value of the required on-time delay dependson the type of lamp and ballast combination used, because eachcombination has different performance characteristics that depend onswitching frequency. For example, if an instant start ballast is used,the required on-time delay may be 30 minutes. If a programmed startballast is used, the value may be 15 minutes. The sensor can beprogrammed with this delay via, for example, the sensor's push button214 or, in other embodiments discussed further below, remotely usingcomputer processing devices coupled to the sensor. Once this minimumrequired on time is met, the other two lamp loss factors, the number ofoff/on transitions and the total amount of lamp on time, become thepredominate operating factors affecting lamp life.

Because energy usage is also a cost consideration in fluorescent lampoperation, maximizing lamp life alone by simply leaving the lamps on forlong periods of time may not be the obvious solution that the graph ofFIG. 4 seems to indicate unless, of course, a particular lightingcontrol zone covers, for example, a windowless continuously occupiedarea that requires constant lighting. For those lighting control zonesthat do not need lamps to be on constantly, the benefit of longer lamplife obtained from keeping the lamps on for long periods of time may beoffset by increased energy cost—the longer a lamp is on, the higher theenergy cost. However, the benefit of turning off lamps when not neededalso needs to be weighed against lamp loss caused by an increased numberof off/on transitions resulting from the lamps being turned off moreoften.

FIG. 5 shows a flowchart of one embodiment of an algorithm that canmaximize lamp life and energy savings according to the invention.Algorithm 500 can be implemented in software or firmware or combinationsof both and can be executed by an occupancy sensor of the invention suchas occupancy sensors 102 or 302. Algorithm 500 weighs three factorsbased on the lamp's actual usage to automatically determine an optimaltime delay from among a number of selectable time delays available for agiven occupancy sensor. The lamp's usage depends on how the lightingcontrol zone is normally occupied (i.e., the control zone's occupancypattern). The three factors are lamp loss while the lamp is on, lamploss from the number of off/on transitions, and energy usage while thelamp is on. The first two factors are dependent on the types of ballastand lamp used, and the third is dependent on the relative value a userplaces on saving energy versus saving lamp life. If saving energy is nota concern, this factor can be set to zero and the algorithm willoptimize the time delay based solely on lamp life savings. If energysavings is weighed as a factor, energy usage during lamp on time iscounted as a negative, equivalent to loss of lamp life. That is, thetotal lamp life lost for each lamp on period is calculated and then anadditional weighted amount of lost lamp life is added to account forenergy usage. The amount of weighting is set by the user and should bedependent on the relative costs of powering the lamp versus replacingthe lamp.

Algorithm 500 automatically determines the optimal time delay byadvantageously calculating in real time the loss of lamp life based onthe actual occupancy pattern observed by the sensor and on the actual“last detected occupancy” time delay programmed in the sensor (which maybe, for example, the factory default setting). Algorithm 500 alsoconcurrently calculates in real time the loss of lamp life and energyusage for each of the selectable time delays to which the sensor couldbe programmed. That is, the algorithm concurrently simulates the effectof each selectable time delay on lamp life and energy usage as if thesensor were respectively programmed to these time delays. The result isan estimate of the loss of lamp life and energy usage for each of theavailable time delays. Algorithm 500 then chooses the time delay thatresults in the optimal combination of low loss of lamp life and lowenergy usage in accordance with the relative weighting of these factors.

Algorithm 500 can also provide a user with statistics relevant to thelamp's expected lifetime based on the lamp's current “last detectedoccupancy” time delay setting and actual operation as controlled by thesensor. The lamp loss calculated by algorithm 500 is preferably storedin the sensor's microcontroller and can be provided to the user in theform of percent of lamp life used or percent of lamp life remaining viathe push button and LED or a display device (described further below).This allows the user to judge when lamps should be replaced based onactual usage of the lamps. Along with the loss estimate, the totalnumber of off/on transitions and the total on time are also preferablystored in the sensor's microcontroller and can be provided to the user.When the lamps are replaced, this information can easily be reset totrack the operation of the new lamps.

As shown in FIG. 5, algorithm 500 begins by setting the length of a testperiod at block 530. For example, the test period may be two weeks.During this period, the occupancy sensor functions normally with itsprogrammed (e.g., default) “last detected occupancy” time delay, whichmay be, for example, 15 minutes. Delay time settings representing eachof the selectable time delays are also maintained in the sensor duringthis period to simulate the functionality of the selectable time delaysgiven the sensed occupancy conditions. Data is updated in real timebased on the performance of each of the possible time delays. At theconclusion of the test period, the resulting data is used to determinethe optimal time delay. The sensor can be programmed to continueupdating the existing data for a subsequent test period. At theconclusion of the subsequent test period, the data is evaluated and adifferent optimal time delay may be chosen if indicated by the data.This cycle of further refining the data can continue for the life of thesensor or until the user resets the stored history, in which case thealgorithm can begin anew.

At block 532, an off/on counter and a total lamp loss register are setto zero to initialize the algorithm.

At block 534, the off/on counter is incremented each time the lamp turnson.

At block 536, the loss of lamp life resulting from each off/ontransition is calculated using Equation 1.

LossFromStarts=Starts×A   Equation 1

Constant A represents the loss per start for a given lamp/ballastcombination and is described in more detail further below. Loss isdefined as the fraction of the total loss available. Equation 1 can beredefined as necessary to include any factor that may affect the amountof loss for a given start and thus may contain any number of constants.

At block 538, the “lamp on time” timer in the occupancy sensor keepstrack of the time the lamp is on until the lamp turns off (i.e., whileoccupancy is sensed and for the duration of the “last detectedoccupancy” time delay programmed in the sensor).

At block 540, algorithm 500 uses Equations 2 and 3 below to calculatelosses that occurred while the lamp was on. As in Equation 1, Equations2 and 3 can be redefined as necessary to include any factor that mayaffect the cumulative loss and thus may contain any number of constants.Note that the rate of loss decreases as the length of time the lamp ison increases. Constant B represents the initial instantaneous loss rategiven a particular lamp/ballast combination. Constant C represents therate of change in the instantaneous loss and is also dependent on theparticular lamp/ballast combination. (Constants B and C are describedmore fully below.) Equation 2 is only applied until the instantaneousloss rate reaches zero as defined by Equation 3.

$\begin{matrix}{{CumulativeLoss} = {{(B){TimeOn}} - {\left( \frac{C}{2} \right){TimeOn}^{2}}}} & {{Equation}\mspace{14mu} 2} \\\begin{matrix}{{InstLoss} = {\frac{}{t}\left\lbrack {{(B){TimeOn}} - {\left( \frac{C}{2} \right){TimeOn}^{2}}} \right\rbrack}} \\{= {(B) - {(C){TimeOn}}}}\end{matrix} & {{Equation}\mspace{14mu} 3}\end{matrix}$

At block 542, the total loss for a first “event,” which is defined as astart (off/on transition) followed by a discrete period of lamp on time,is summed using Equation 4.

$\begin{matrix}{{LossFromEvent} = {A + {(B){TimeOn}} - {\left( \frac{C}{2} \right){TimeOn}^{2}}}} & {{Equation}\mspace{14mu} 4}\end{matrix}$

Constants A, B, and C used in Equations 1-4 are based on the type oflamp/ballast combination used in the lighting unit. The lamp life vs.time-on-per-cycle graphs published by lamp and ballast manufacturers arebased on lamps that are cycled at different rates within a range ofrates, where each rate is applied repeatedly until the lamp burns out.This situation is different than actual lamp usage where thetime-on-per-cycle typically varies widely throughout the life of thelamp. Because each time-on-per-cycle is the same in the published data,the loss from each cycle can be assumed to be the same. Therefore,because the loss from each cycle is an equal fraction of the total lossavailable, the total number of cycles that will occur for a giventime-on-per-cycle can be determined as shown in Equation 5.

$\begin{matrix}{{TotalCycles} = \frac{1}{LossFromCycle}} & {{Equation}\mspace{14mu} 5}\end{matrix}$

The total number of cycles is then multiplied by the time-on-per-cycleto determine the total lamp life as shown in Equation 6.

$\begin{matrix}\begin{matrix}{{LampLife} = \frac{{TimeOn}/{Cycle}}{LossFromCycle}} \\{= \frac{{TimeOn}/{Cycle}}{\begin{matrix}{A + {(B)\left( {{TimeOn}/{Cycle}} \right)} -} \\{\left( \frac{C}{2} \right)\left( {{TimeOn}/{Cycle}} \right)^{2}}\end{matrix}}}\end{matrix} & {{Equation}\mspace{14mu} 6}\end{matrix}$

From Equation 6, which relates the time-on-per-cycle to lamp life,values for the constants A, B and C can be found such that the resultsclosely match the data in the lamp life vs. time-on-per-cycle chartsprovided by manufacturers. One method to determine constants A, B and Cis via an optimization program that optimizes the constants so the errorbetween the formula results and the manufacturers' data is minimized.The program starts with initial values for constants A, B and C andcalculates lamp life using Equation 6 for each of the supplied datapoints. The difference between the lamp life predicted by Equation 6 andthe manufacturers' data is considered the error. The program thenrandomly increments or decrements each constant and rechecks the error.If the error decreases, the new value is kept and the process repeats.The resulting values for constants A, B and C are values that theprogram has determined to have the least collective error relative tothe manufacturer's data. Table 1 below shows the resulting values ofconstants A, B and C for several representative lamp/ballastcombinations. Using Equation 6 and the constants below, the calculatedlamp life for each of the lamp/ballast combinations in Table 1 veryclosely matches the actual lamp life data published by themanufacturers.

TABLE 1 B C Ballast Lamp A (Loss) (Loss/kHr) (Loss/kHr²) Manufacturer AInstant Start Manufacturer B Standard Lamp 1.15E−05 0.0396 1.2000Manufacturer A Instant Start Manufacturer B Deluxe Lamp 1.46E−05 0.02910.4240 Manufacturer A Program Start Manufacturer B Standard Lamp4.68E−06 0.0313 0.6630 Manufacturer A Program Start Manufacturer BDeluxe Lamp 5.39E−06 0.0260 0.0228 Manufacturer C Instant StartManufacturer D Standard Lamp 4.50E−05 0.0560 3.0300 Manufacturer CInstant Start Manufacturer D Deluxe Lamp 5.10E−05 0.0397 0.9300Manufacturer C Program Start Manufacturer D Standard Lamp 1.50E−050.0484 2.3280 Manufacturer C Program Start Manufacturer D Deluxe Lamp1.00E−05 0.0400 1.2629

As algorithm 500 is applied to the actual operation of the lamp ascontrolled by the actual “last detected occupancy” time delay programmedin sensor, algorithm 500 is also applied concurrently to a simulatedoperation of the lamp as would be controlled by each of the availableselectable time delays (i.e., the selectable time delays other than theactual time delay programmed in the sensor). At block 538X, respectivetimers implemented in the firmware of the microcontroller in theoccupancy sensor keep track of the time the lamp is on or would be onfor each of the “simulated” selectable time delays. These timers tracklamp on time through the full duration of the respective simulated timedelays, even if the actual lamp has turned off because of expiration ofthe actual programmed time delay. Then, as each simulated time delayexpires, algorithm 500 uses the respective value of the timer associatedwith that simulated time delay to calculate the lamp loss for thatsimulated time delay.

FIG. 6 illustrates the simulated time delays in relation to the actualtime delay. Actual time delay 660 and simulated time delays 662, 664,and 666 begin at the same time 661 of last detected occupancy. Forsimulated time delay 662, algorithm 500 will continue tracking lamp ontime as if the lamp never turned off and will not count off/ontransition 663 for that simulated delay time, because the length ofsimulated time delay 662 extends beyond both the actual time delay 660and the actual occurrence of the next off/on transition 663. Thus, thelamp would not have turned off and then back on again had simulated timedelay 662 been programmed in the sensor. Similarly, because simulatedtime delay 664 is longer than actual time delay 660, but expires beforethe actual occurrence of next off/on transition 663, algorithm 500 willcalculate the simulated time delay's lamp loss with the shorter off time665. And lastly, because simulated time delay 666 is shorter than actualtime delay 660, algorithm 500 will not treat the on time difference 667between simulated time delay 666 and actual time delay 660 as lamp ontime against simulated time delay 666, because the lamp would haveturned off had simulated time delay 666 been programmed in the sensor.

Returning to FIG. 5, block 544 determines whether the test period hasended. If not, the algorithm returns to block 534 and awaits anotheroff/on transition, whereupon blocks 536, 538, and 540 perform the samefunctions for this next event.

The calculation at block 542, however, now expands to also calculate thetotal cumulative loss from all observed events. That is, algorithm 500calculates at block 542 the loss from each event as it occurs usingEquation 4 and then sums the result with the previous total losses usingEquation 7 below to keep a running total of the cumulative lamp lossfrom the series of observed off/on transitions and accompanying lamp ontimes.

$\begin{matrix}{{TotalLoss} = {\sum\limits_{i = 1}^{n}{LossFromEvent}_{i}}} & {{Equation}\mspace{14mu} 7}\end{matrix}$

When the test period ends, the total cumulated lamp loss calculatedduring the test period for each selectable time delay, including thesimulated time delays and the actual time delay programmed in thesensor, are compared at block 546 to determine which time delay has thelowest lamp loss. If the occupancy sensor has been optionally programmedto at this point only report the results of the analysis to a user,algorithm 500 may await a reply from the user before proceeding further.

Preferably, however, the occupancy sensor is programmed to automaticallyreplace at block 548 the currently programmed time delay with theoptimal time delay most recently determined to have the lowestcalculated lamp loss.

In alternative embodiments of the invention, the occupancy sensor has asecond and/or a third time delay setting in addition to the programmabletime delay setting. The programmable time delay setting is automaticallyset internally by algorithm 500 to the most recently determined optimaltime delay, whereas the second and third time delay settings have valuesthat are user selectable. If a user sets the second time delay, the lampwill not be permitted to turn off after the “last detected occupancy”timer activates until the value of this timer exceeds both theprogrammable and second time delays. If a user sets the third timedelay, the lamp will turn off after the “last detected occupancy” timeractivates when the value of this timer exceeds the third time delayregardless of the value of the programmable time delay. In other words,the second and third programmable time delay settings override theinternally set programmable time delay setting when the programmabletime delay is either less than the second time delay or more than thethird time delay.

To summarize the operation of the occupancy sensor with respect to thevarious time delays described above, in the first embodiment, lamps willnot turn off until they have been on for the required on-time delay andoccupancy has not been detected for the full duration of the programmedoptimal “last detected occupancy” time delay. In an alternativeembodiment, the lamps will not turn off until the lamps have been on forthe required on-time delay and occupancy has not been detected for thelonger of the full duration of the programmed optimal time delay or theuser programmed second time delay. In the same or another alternativeembodiment, the lamps will turn off when they have been on for therequired on-time delay and occupancy has not been detected for theshorter of the full duration of the programmed optimal time delay or theuser programmed third time delay.

The occupancy sensor is also preferably programmed to automaticallyrepeat algorithm 500 for another test period. At block 550, userprogramming indicates whether algorithm 500 will repeat with cumulativelamp loss data or will repeat anew with fresh data, such as, forexample, when a new lamp is installed. If algorithm 500 is to repeatanew, control returns to block 532, where the off/on counter and totallamp loss register are reset to zero. If algorithm 500 is to repeat withcumulative data, control returns to block 534, where the next off/ontransition is awaited. Note that algorithm 500 uses the cumulative lamploss data to also continue updating the lamp's current lamp life status.A third option (not shown in FIG. 5) is to repeat the algorithm withcumulative data, but to weigh it less in the determination of an optimaltime delay for the current test period. A user can program the weightingof the cumulative data. This prevents, for example, previous outdatedoccupancy patterns from incorrectly influencing the calculations, suchas, for example, when a file room is converted into an office. A usercan set the weighting of the cumulative data to zero, which preventsthat data from influencing the current calculations, but still allowsthe cumulative data to be used to determine remaining lamp life.

Table 2 and FIG. 7 show an example of lamp losses calculated byalgorithm 500 for a plurality of selectable time delays based on alighting control zone having an occupancy pattern characterized byrelatively short unoccupied periods that average less then ten minutesthroughout the day followed by long unoccupied periods overnight. Asshown, the results of algorithm 500 indicate that the optimal time delayfor this occupancy pattern is 10 minutes—a time delay long enough toprevent the lights from turning off during the short unoccupied periodsduring the day, but still short enough to allow the lights to turn offwithout wasting unnecessary on time during the long unoccupied periodsovernight. Note that the shortest time delay (5 minutes) incurs lamploss predominately from the excessive starts (off/on transitions), whilethe longest time delays (30+ minutes) incur lamp loss predominately fromthe excessive on times without any reduction in the number of starts.

TABLE 2 Time Delay Starts Time On(Hours) Fraction Of Lamp Life Lost  5Minutes 44 77.7 0.0033966 10 Minutes 27 77.2 0.0030761 15 Minutes 2779.3 0.0031505 20 Minutes 24 81.2 0.0031680 25 Minutes 23 83.1 0.003219930 Minutes 22 84.9 0.0032666 35 Minutes 22 86.7 0.0033305 40 Minutes 2288.6 0.0033942

FIG. 8 shows the effect of the calculated lamp losses per time delayabove on lamp life 880 and calendar life 882 of the lamp. Although thenumber of operating hours increases just slightly with longer timedelays for lamp life 880, actual calendar life 882 benefits from theshorter, optimal time delay of 10 minutes, which corresponds to about423 weeks of calendar life versus 387 weeks of calendar life for a 40minute time delay. Also note from FIG. 4 that the lamp life of about25,000 hours resulting from the 10 minute time delay is equivalent to aT8 fluorescent lamp cycled at about 275 minutes (about 4.6 hours) perstart. Algorithm 500 has thus advantageously maximized energy savingswithout sacrificing lamp life.

Table 3 and FIG. 9 show a second example of lamp losses calculated byalgorithm 500 for a plurality of selectable time delays. In thisexample, the lighting control zone is unoccupied for periods averagingabout fifteen minutes throughout the day. As shown, the results ofalgorithm 500 indicate that the optimal time delay for this occupancypattern is 20 minutes—a time delay that will prevent the lamps fromturning off during those unoccupied fifteen minute periods. The resultsindicate that the lamp loss caused by the lamps staying on during thoseunoccupied fifteen minute periods is less than the lamp loss caused bythe increased number of starts (on/off transitions) that would resultfrom a shorter time delay.

TABLE 3 Time Delay Starts Time On(Hours) Fraction Of Lamp Life Lost  5Minutes 50 73.3 0.0033523 10 Minutes 31 75.2 0.0030791 15 Minutes 2776.2 0.0030344 20 Minutes 22 77.2 0.0029656 25 Minutes 22 78.9 0.003024330 Minutes 21 80.6 0.0030707 35 Minutes 21 82.3 0.0031317 40 Minutes 2184.1 0.0031925

FIG. 10 shows the effect of the calculated lamp losses per time delayfor the second example on the lamp life and calendar life of the lamp.Again, although the number of operating hours increases just slightlywith longer time delays for lamp life 1080, actual calendar life 1082benefits from the shorter, optimal time delay of 20 minutes, whichcorresponds to about 443 weeks of calendar life versus 411 weeks ofcalendar life for a 40 minute time delay.

Lamp life status and related information can be communicated to a userby occupancy sensors 102 and 302 via their programmable push buttons andLEDs. A user can request the percent of lamp life used, the number ofoff/on transitions, and the number of lamp on hours by pushing the pushbutton a specified number of times to retrieve a given piece ofinformation. The information is then fed back to the user throughconsecutive blinks of the LED. For example, to retrieve the percent oflamp life used in one embodiment, the user presses the push button threetimes. The first digit of the percent of lamp life used is communicatedto the user by a number of consecutive LED blinks. After a pause, thesecond digit is communicated in the same manner. A value of zero for adigit is fed back via a short sequence of rapid flashing of the LED.After the percent is fed back to the user, a long pause occurs and thecycle may repeat a number of times (e.g., three times). Thus, if lamplife used is 60%, the LED first blinks six times followed by a pause andthen a short sequence of rapid flashing. Similarly, to retrieve thenumber of off/on transitions, the push button may need to be pressed,for example, four times. To retrieve the number of lamp on hours, thepush button may need to be pressed, for example, five times. To shortenthe information that needs to be communicated, the number of off/ontransitions may be represented as thousands of starts and the number oflamp on hours may be represented in thousands of hours. Lamp lifeinformation and the collected time delay data can also be cleared fromthe sensor by a respective series of push button commands.

Occupancy sensors of the invention may also be programmed to alert auser that lamps should be replaced. For example, the sensor'smicrocontroller can be programmed to cause the sensor's LED to blinkslowly and continuously when lamp loss exceeds a pre-set amount, suchas, for example, 99%. Alternatively or additionally, the sensor mayprovide an audible alert when, for example, lamp loss exceeds a pre-setamount and the push button is pressed (regardless of the reason forpressing the push button), thus alerting a user with sound that thelamps controlled by the sensor should be replaced.

FIG. 11 shows another embodiment of the invention. Networked occupancysensor 1102 is coupled to various devices capable of either programmingsensor 1102, displaying information received from sensor 1102, and/orstoring data received from sensor 1102. Occupancy sensor 1102 is coupleddirectly to a stand-alone personal computer 1122 and a gateway 1124 viapreferably standard category 5 (“CAT-5”) cabling 1105. Gateway 1124 isin turn coupled to a preferably Ethernet local area network (“LAN”)1125, to which host computer 1126 and handheld computer device 1128 areboth coupled. Sensor 1102, which is operative to execute software orfirmware embodying algorithm 500, transmits information and data eitherautomatically or as requested by a user that may include the sensor'scurrent settings and operational status and the associated lamp's statusincluding, for example, remaining lamp life, as tracked by the sensorand calculated by algorithm 500. Occupancy sensor 1102 may be programmedby, and may have information/data transmitted from it displayed byand/or stored in personal computer 1122, gateway 1124, host computer1126, and/or handheld computer device 1128.

FIG. 12 shows a hardware embodiment of networked occupancy sensor 1102in accordance with the invention. Occupancy sensor 1102 includesintegrated microcontroller 1210, PIR detector 1211, optional sounddetector (microphone) 1212, optional daylight detector (photocell) 1213,programmable push button 1214, connector ports 1215 a and 1215 b,transceiver 1216, voltage regulators 1217 and 1218, reset chip 1219, LED1220, H-bridge #1, optional H-bridge #2, relay #1, optional relay #2,and optional dimming outputs #1 and #2 (for use with dimmable lightingballasts and daylight detector 1213). Occupancy sensor 1102 can beprogrammed to operate with either PIR detection or both PIR and sounddetection. (The PIR and sound detection technology may be the same asthat disclosed in, for example, U.S. Pat. No. 5,701,117). Reset chip1219 monitors the preferably 3.3 volts from regulator 1218 and disablesthe microcontroller via a reset pin if the voltage falls below a setlevel, such as, for example, 2.8 volts. This prevents themicrocontroller from possibly malfunctioning or locking up should itsinput voltage drop below a certain level. The H-bridges allow thesensors to throw the relays in either direction. That is, the H-bridgesare circuits that allow current to pass in either direction (i.e.,either polarity) through the relay coil to allow the rely to switch ineither direction. Microcontroller 1210, which is operative to executesoftware and/or firmware, is preferably a Texas Instruments MSP430F2272,transceiver 1216 is preferably an RS-485 Analog Devices ADM3493, andreset chip 1219 is preferably a TelCom Semiconductor TC54VN27 voltagedetector. Occupancy sensor 1102 may be a line voltage sensor (having atleast one relay) coupled directly to lighting units or a low voltagesensor (having neither relay #1 nor relay #2) coupled to a powersupply/relay device, which is coupled to lighting units.

As with occupancy sensors 102 and 302, the invention can include othertypes of networked occupancy sensors having different sensingcapabilities in order to provide occupancy detection for rooms and areashaving a wide variety of characteristics and configurations. Thedifferent types include ceiling mounted extended range 360° sensors forplacement in large rooms or areas; high bay 360° sensors for placementin areas with high ceilings such as warehouses and gymnasiums; corner orceiling mounted wide view sensors for placement in areas such asclassrooms; and wall or ceiling mounted hallway sensors for placement inlong narrow areas such as hallways or corridors. U.S. Pat. Nos.6,215,398 and 6,304,180 each disclose occupancy sensing technologiesthat may be used in networked occupancy sensors of the invention. Allnetworked occupancy sensors of the invention have integratedmicrocontrollers and firmware and the ability to communicate eitherdirectly or via a network to a display device, and can be programmedeither locally via a push button on the sensor or remotely via othercomputer processing devices. Occupancy sensors of the invention may beconnected to other devices such as power packs, wall units, and daylightsensors using preferably CAT-5 cabling, and may operate with low voltageor line voltage. Low voltage sensors do not have a relay and thuscommunicate with relays located elsewhere within the lighting controlzone. Multiple occupancy sensors can be used in the same zone to providecoverage for oddly shaped rooms or large open areas. Note that thevarious embodiments of occupancy sensors that can be used with theinvention may not have all of the sensing and output components shown inFIG. 12. For example, some sensors may not have relays or only onerelay. Other sensors may not have dimming outputs or only one dimmingoutput. While still other sensors may not have daylight detector(photocell) 1213, PIR detector 1211, or sound detector (microphone)1212.

Networked occupancy sensor 1102 may be part of an independentlocally-operated lighting control zone coupled directly to a stand-alonecomputer and/or one or more other devices having processing and/ordisplay capabilities. Alternatively, occupancy sensor 1102 may be partof a lighting control system 1100 as shown in FIG. 11. Lighting controlsystem 1100 has three main components: devices, lighting control zones,and a network backbone. Devices include, for example, occupancy sensors,daylight sensors, power supply/relay units, and wall switch units. Eachdevice has the ability to communicate over the network backbone andpreferably has an integrated microcontroller and firmware and RJ-45style connector ports. The lighting control system may be controlled viahost computer 1126 executing Web-based control software. The lightingcontrol system may also be controlled via a gateway (e.g., gateway 1124,discussed in more detail below) or a laptop or other computer,workstation, or handheld device (e.g., handheld computer device 1128)that can remotely access the Web-based control software. Device andcommunication power may be delivered via CAT-5 cabling connected to adevice's RJ-45 connector port, or may be connected directly from a powersupply to a device's power terminal connector, if so equipped.

Gateway 1124 is part of the network backbone of lighting control system1100. Gateway 1124 transports and routes information between multiplelighting control zones (not shown) and the Web-based control software.Gateway 1124 interconnects multiple lighting control zones preferablyusing CAT-5 cabling and communicates over LAN 1125 using standardEthernet and TCP/IP communication protocols. Gateway 1124 is preferablya 2-gang low voltage wall unit that mounts to a 2-gang junction box, andhas a LAN connector port and several preferably RJ-45 connector portsfor connection to downstream lighting control zones via CAT-5 cabling.Gateway 1124 acts both as a communication access point for the system'scontrol software and as a local control device for accessing anydownstream device including, for example, occupancy sensor 1102. Gateway1124 has a display screen 1127, which is preferably a backlit LCD(liquid crystal display) screen, and control keys 1129, which may beconventional keypad devices. Using the display screen and control keys,users can request and display various lamp life data and statistics andoccupancy sensor settings and status.

FIG. 13 shows a hardware embodiment of gateway 1124 that can be used toexecute software or firmware embodying algorithm 500 and/or that canstore lamp and occupancy related information/data downloaded fromnetworked occupancy sensor 1102 in accordance with the invention.Gateway 1124 includes a microprocessor 1310, a memory board containingmemory devices 1371, 1373, and 1375, signal microcontroller 1376, CPUclock 1377, LAN clock 1378, LAN transceiver 1379A,B, three transceivers1316 a-c, switching voltage regulator 1318, and display/driver 1323.Microprocessor 1310 is preferably an 8-bit Rabbit 3000 microprocessorfrom Rabbit Semiconductor. Microprocessor 1310 is operative to executesoftware or firmware embodying algorithm 500 and preferably has hardwareand/or software support for TCP/IP, IrDA, SDLC/HDLC, Async, SPI, andI2C; 56+ digital I/O; and six serial ports. The application codeexecuted by the microprocessor comprises API calls and hardware driversto implement most TCP/IP protocols. Memory device 1371 is preferably a512 KB flash memory used to store the application code and gatewayconfiguration block parameters. Memory device 1373 is preferably a 512KB FSRAM (fast static random access memory) used by the application codeand stack software for variables and communication buffers. And memorydevice 1375 is preferably a 512 KB SRAM (static random access memory)used to store information and data received from occupancy sensor 1102and lighting control information for the lighting control zonesconnected to the gateway. CPU clock 1377 includes a main CPU oscillatorand a real-time clock oscillator. LAN clock 1378 is preferably anEthernet driver oscillator. These clocks are each individual circuitsthat provide each module with their respective operational frequency.LAN transceiver 1379A,B is preferably a 10/100 Ethernet MAC/PHY (mediaaccess control/physical layer) driver and associated magnetics,respectively. Transceivers 1316 a-c are preferably EIA 485 transceiverscoupled respectively to preferably RJ-45 connector ports. Using threeUARTs (universal asynchronous receiver/transmitters) from microprocessor1310, the gateway can interface with occupancy sensor 1102 and otherlighting control zones connected to the three connector ports. Switchingregulator 1318 is a DC/DC step-down switching regulator, anddisplay/driver 1327 is an LCD (liquid crystal display) driver displaythat may be implemented using Desintron F-STN positive display DV5520BB(132 W×64 H pixels). Display/driver 1327 includes four control keys: up1329 a, down 1329 b, right (enter) 1329 c, and left (escape) 1329 d.Microprocessor 1310 checks for any key presses and then performs anddisplays the respective action on display screen 1127.

U.S. patent application Ser. No. 12/116,185, which discloses a lightingcontrol system that includes occupancy sensors, gateways, an EthernetLAN network, lighting control software, and other components andfeatures that may be used with the invention, is incorporated herein byreference.

FIG. 14 shows an example of a screen display of lamp life status thatmay be displayed on any one of, for example, personal computer 1122,gateway 1124, host computer 1126, and/or handheld computer device 1128in accordance with the invention. Display 1400 lists the remaining lamplife of lamps located in four lighting control zones of a lightingcontrol system. An occupancy sensor of the invention located in each ofthe four lighting control zones executes software or firmware embodyingalgorithm 500. Algorithm 500 calculates the loss of lamp life for thelamps in each of the four lighting control zones based on the type oflamp/ballast combinations used and the particular occupancy patternssensed in those lighting control zones. The calculated losses, which maybe converted to percentage of lamp life remaining, are transmitted bythe four occupancy sensors to preferably a gateway, such as gateway1124, or other computer processing device that can format the receiveddata for display either on its own display screen and/or on anotherdisplay device as requested by a user. The invention advantageouslypermits, for example, a building manager to review the status of lampsand then take appropriate action as needed. As shown in FIG. 14, thelamps in zone 1 still have more than half their lamp life remaining, asdo the lamps of zones 3 and 4. However, the lamps of zone 2 are neartheir end-of-life and should soon be replaced. An optional audible alertmay accompany the display of zone 2's lamp life status. The buildingmanager can now assign maintenance personnel to replace the lamps inzone 2 before they burn out, thus avoiding any inconvenience ordangerous and/or hazardous conditions that could result from burnt outlamps.

Other information and data related to lamp usage and sensor operationcan also be displayed in accordance with the invention. For example, thegraphs of FIGS. 7-10 can be displayed to permit a user to review thedata calculated by algorithm 500. Also, the current number of off/ontransitions, total lamp on time, lamp loss per simulated and actualdelay times, settings of various delay times, and values of varioussensor timers can also be requested by a user and displayed on a displaydevice.

The software or firmware embodying algorithm 500 is not limited to beingexecuted by an occupancy sensor of the invention. Alternatively, suchsoftware or firmware can be executed by other devices having amicrocontroller, microprocessor, or computer processor of sufficientprocessing capability and memory capacity coupled to an occupancy sensorof the invention. In these cases, the occupancy sensor transmits datapertaining to occupancy, time delay status, and lamp status to thedevice executing the software or firmware embodying algorithm 500. Forexample, any one of local computer 1122, gateway 1124, host computer1126, and/or handheld computer device 1128 could execute software orfirmware embodying algorithm 500, provided they have sufficientprocessing capability and memory capacity.

Also, data gathered and/or calculated by algorithm 500 and itsassociated occupancy sensor, such as lamp loss, the total number ofoff/on transitions, the total on time of a lamp, optimal time delaysetting, etc., is not limited to being stored in the associatedoccupancy sensor, but can be alternatively downloaded and storedremotely in, for example, any one of local computer 1122, gateway 1124,host computer 1126, handheld computer device 1128, and/or otherremotely-connected computers, provided sufficient memory capacity existsin the device.

In an alternative embodiment of the invention, an occupancy sensorcontrols the on/off state of a lamp and tracks the number of off/ontransitions and the amount of time the lamp is on for a lamp it iscontrolling. The sensor includes a first timer set to a first time delaythat is operative to activate upon the sensor detecting vacancy afteroccupancy had been detected and to deactivate upon expiration of thefirst time delay, the first timer operative to prevent the sensor fromturning off the lamp upon activation of the first timer and for theduration of the first time delay. The sensor also includes a counteroperative to count the number of times the lamp turns on (i.e., theoff/on transitions), a second timer operative to activate upon the lampturning on and deactivate upon the lamp turning off, and a registeroperative to store a cumulative amount of time the lamp is on as trackedby the second timer. This information can then be used to latercalculate lamp life and energy usage of the lamp either at the sensoritself if equipped with appropriate processing means (e.g., amicrocontroller executing appropriate firmware and/or software) orremotely at a gateway or computer executing appropriate firmware and/orsoftware. The tracked and calculated data can be provided to a user viathe push button and LED of the sensor, a display on the sensor, or adisplay device coupled to the sensor and/or the gateway or computer.

In another alternative embodiment of the invention, an occupancy sensorconcurrently calculates the number of times a lamp would turn on (i.e.,off/on transitions) and the amount of time a lamp would be on for eachof a selectable number of time delays to which the sensor could beprogrammed. That is, algorithm 500 is used to concurrently simulate theeffect of each selectable time delay on the number of starts (i.e.,off/on transitions) and the amount of lamp on time as if the sensor's“last detected occupancy” timer were respectively programmed to thesetime delays. The result is an estimate of the number of starts and theamount of lamp on time the lamp would experience for each of theselectable time delays. This information can then be used to calculatelamp life and energy usage for each of the selectable time delays. Thesimulated and calculated data can be fed back to a user via the pushbutton and LED of the sensor, a display on the sensor, or a displaydevice coupled to the sensor. This data can also be used by the sensorto automatically determine an optimal time delay for the “last detectedoccupancy” timer

In yet another alternative embodiment of the invention, an occupancysensor not controlling the on/off operation of a lamp in a lightingcontrol zone monitored by the sensor can still be used to determine anoptimal time delay setting for the “last detected occupancy” timer andto estimate loss of lamp life and/or energy usage of that lamp based onan observed occupancy sensor pattern in that lighting control zone.

The invention is also not limited to use with fluorescent lamps, but canbe used alternatively with other types of lamps provided thatappropriate lamp loss equations and lamp life data are available.

Thus it is seen that occupancy sensors that measure lamp loss areprovided. One skilled in the art will appreciate that the invention canbe practiced by other than the described embodiments, which arepresented for purposes of illustration and not of limitation, and theinvention is limited only by the following claims.

1. An occupancy sensor that controls the on/off state of a lamp, thesensor comprising: a first timer set to a first time delay, the firsttimer operative to activate upon the sensor detecting vacancy afteroccupancy had been detected and to deactivate upon expiration of thefirst time delay, the first timer operative to prevent the sensor fromturning off the lamp upon activation of the first timer and for theduration of the first time delay; a counter operative to count thenumber of times the lamp turns on; a second timer operative to activateupon the lamp turning on and deactivate upon the lamp turning off; and aregister operative to store a cumulative amount of time the lamp is onas timed by the second timer.
 2. The sensor of claim 1 wherein the lampis a fluorescent lamp.
 3. The sensor of claim 1 further comprising apush button and a light emitting diode wherein, in response to actuationof the push button, the sensor is operative to communicate viaactivation of the light emitting diode at least one of the cumulativeamount of time the lamp is on or the number of times the lamp turns on.4. The sensor of claim 1 further comprising a push button wherein, inresponse to actuation of the push button, the sensor is operative toclear stored data in the counter or the register pertaining to at leastone of the cumulative amount of time the lamp is on or the number oftimes the lamp turns on.
 5. The sensor of claim 1 further comprising amicrocontroller operative to execute firmware or software thatcalculates at least one of a loss of lamp life or energy used by thelamp based on the number of times the lamp is turned on and thecumulative amount of time the lamp is on.
 6. The sensor of claim 5wherein the microcontroller is operative to store data pertaining to atleast one of the loss of lamp life or the energy used by the lamp. 7.The sensor of claim 6 further comprising a push button and a lightemitting diode wherein, in response to actuation of the push button, themicrocontroller is operative to communicate via activation of the lightemitting diode at least one of the loss of lamp life or the energy usedby the lamp.
 8. The sensor of claim 5 further comprising a displaydevice coupled to the sensor operative to display information pertainingto at least one of the loss of lamp life, the number of times the lamphas turned on, the cumulative amount of time the lamp has been on, andthe cumulative energy used by the lamp.
 9. The sensor of claim 1 furthercomprising a third timer set to a third time delay, the third timeroperative to activate upon the lamp turning on and deactivate uponexpiration of the third time delay, the third timer operative to preventthe sensor from turning off the lamp upon activation of the third timerand for the duration of the third time delay regardless of whether ornot occupancy is sensed by the sensor during the duration of the thirdtime delay.
 10. A lighting control system for controlling the on/offstate of a lamp, the system comprising: the occupancy sensor of claim 1;a lighting unit comprising a fluorescent lamp; a relay coupled to thelighting unit and to a source of line voltage, the relay operative tocouple and decouple line voltage to the lighting unit; and a powersupply coupled to a source of line voltage operative to supply power tothe occupancy sensor and the relay.
 11. The sensor of claim 1 furthercomprising a passive infrared sensing technology for sensing occupancy.12. The sensor of claim 1 further comprising an integral relay forconnecting and disconnecting power to the lamp.
 13. An occupancy sensorthat controls the on/off state of a lamp, the sensor comprising: a firsttimer set to a first time delay, the first timer operative to activateupon the sensor detecting vacancy after occupancy had been detected andto deactivate upon expiration of the first time delay, the first timeroperative to prevent the sensor from turning off the lamp uponactivation of the first timer and for the duration of the first timedelay; and a microcontroller operative to execute firmware or softwarethat simulates an effect of each of a plurality of selectable first timedelays on the operation of the lamp by the sensor and determines thenumber of times the lamp would turn on and the cumulative amount of timethe lamp would be on for each of the plurality of selectable first timedelays.
 14. The sensor of claim 13 wherein the microcontroller isoperative to store data pertaining to at least one of the cumulativeamount of time the lamp would be on or the number of times the lampwould turn on for each of the plurality of selectable first time delays.15. The sensor of claim 14 further comprising a push button and a lightemitting diode wherein, in response to actuation of the push button, themicrocontroller is operative to communicate via activation of the lightemitting diode at least one of the cumulative amount of time the lampwould be on or the number of times the lamp would turn on for any one ofthe plurality of selectable first time delays.
 16. The sensor of claim14 further comprising a push button wherein, in response to actuation ofthe push button, the microcontroller is operative to clear stored datapertaining to at least one of the cumulative amount of time the lampwould be on or the number of times the lamp would turn on for any one ofthe plurality of selectable first time delays.
 17. The sensor of claim14 wherein the microcontroller is operative to execute firmware orsoftware that calculates at least one of the loss of lamp life or theenergy used by the lamp based on the number of times the lamp would turnon and the cumulative amount of time the lamp would be on for each ofthe plurality of selectable first time delays.
 18. The sensor of claim17 further comprising a display device coupled to the sensor operativeto display information for any one of the plurality of selectable firsttime delays pertaining to at least one of the loss of lamp life, thenumber of times the lamp would turn on, the cumulative amount of timethe lamp would be on, the cumulative energy used by the lamp, and theselected time delay.
 19. The sensor of claim 17 wherein themicrocontroller is operative to store data pertaining to at least one ofthe loss of lamp life or the energy used by the lamp for each of theplurality of selectable first time delays.
 20. The sensor of claim 19further comprising a push button and a light emitting diode wherein, inresponse to actuation of the push button, the microcontroller isoperative to communicate via activation of the light emitting diode atleast one of the loss of lamp life or the energy used by the lamp forany one of the plurality of selectable first time delays.
 21. The sensorof claim 19 wherein the microcontroller is operative to select a timedelay from among the plurality of selectable first time delays based onat least one of the loss of lamp life or the energy used by the lamp foreach of the plurality of selectable first time delays.
 22. The sensor ofclaim 21 wherein the time delay selected by the microcontroller islimited to a minimum and maximum value programmable by a user.
 23. Thesensor of claim 21 wherein the first timer is automatically set by themicrocontroller to the time delay selected by the microcontroller. 24.The sensor of claim 21 wherein after the time delay is selected by themicrocontroller, the data pertaining to at least one of the loss of lamplife or the energy used by the lamp is cleared.
 25. The sensor of claim21 wherein after the time delay is selected by the microcontroller, thedata pertaining to at least one of the loss of lamp life or the energyused by the lamp is maintained and used in subsequent selections of atime delay by the microcontroller.
 26. The sensor of claim 13 furthercomprising a second timer set to a second time delay, the second timeroperative to activate upon the lamp turning on and deactivate uponexpiration of the second time delay, the second timer operative toprevent the sensor from turning off the lamp upon activation of thesecond timer and for the duration of the second time delay regardless ofwhether or not occupancy is sensed by the sensor during the duration ofthe second time delay.
 27. A lighting control system for controlling theon/off state of a lamp, the system comprising: the occupancy sensor ofclaim 13; a lighting unit comprising a fluorescent lamp; a relay coupledto the lighting unit and to a source of line voltage, the relayoperative to couple and decouple line voltage to the lighting unit; anda power supply coupled to a source of line voltage operative to supplypower to the occupancy sensor and the relay.
 28. The sensor of claim 13further comprising a passive infrared sensing technology for sensingoccupancy.
 29. The sensor of claim 13 further comprising an integralrelay for connecting and disconnecting power to the lamp.
 30. Anoccupancy sensor that controls the on/off state of a lamp, the sensorcomprising: a first timer set to a first time delay, the first timeroperative to activate upon the sensor detecting vacancy after occupancyhad been detected and to deactivate upon expiration of the first timedelay, the first timer operative to prevent the sensor from turning offthe lamp upon activation of the first timer and for the duration of thefirst time delay; and a microcontroller operative to execute firmware orsoftware that calculates in real time at least one of a loss of lamplife or energy used by the lamp based on actual operation of the lamp ascontrolled by the sensor.
 31. The sensor of claim 30 wherein themicrocontroller is operative to store data pertaining to at least one ofthe loss of lamp life or the energy used by the lamp.
 32. The sensor ofclaim 31 further comprising a push button and a light emitting diodewherein, in response to actuation of the push button, themicrocontroller is operative to communicate via activation of the lightemitting diode at least one of the loss of lamp life or the energy usedby the lamp.
 33. The sensor of claim 31 further comprising a push buttonwherein, in response to actuation of the push button, themicrocontroller is operative to clear stored data pertaining to at leastone of the loss of lamp life or the energy used by the lamp.
 34. Thesensor of claim 30 further comprising a second timer set to a secondtime delay, the second timer operative to activate upon the lamp turningon and deactivate upon expiration of the second time delay the secondtimer operative to prevent the sensor from turning off the lamp uponactivation of the second timer and for the duration of the second timedelay regardless of whether or not occupancy is sensed by the sensorduring the duration of the second time delay.
 35. A lighting controlsystem for controlling the on/off state of a lamp, the systemcomprising: the occupancy sensor of claim 30; a lighting unit comprisinga fluorescent lamp; a relay coupled to the lighting unit and to a sourceof line voltage, the relay operative to couple and decouple line voltageto the lighting unit; and a power supply coupled to a source of linevoltage operative to supply power to the occupancy sensor and the relay.36. The sensor of claim 30 further comprising a passive infrared sensingtechnology for sensing occupancy.
 37. The sensor of claim 30 furthercomprising an integral relay for connecting and disconnecting power tothe lamp.
 38. The sensor of claim 30 further comprising a display devicecoupled to the sensor operative to display information pertaining to atleast one of the loss of lamp life or the energy used by the lamp. 39.An occupancy sensor that controls the on/off state of a lamp, the sensorcomprising: a first timer set to a first time delay, the first timeroperative to activate upon the sensor detecting vacancy after occupancyhad been detected and to deactivate upon expiration of the first timedelay, the first timer operative to prevent the sensor from turning offthe lamp upon activation of the first timer and for the duration of thefirst time delay; and a microcontroller operative to execute firmware orsoftware that calculates in real time at least one of a loss of lamplife or energy used by the lamp based on a simulated operation of thelamp as controlled by the sensor for each of a plurality of selectablefirst time delays.
 40. The sensor of claim 39 wherein themicrocontroller is operative to store data pertaining to at least one ofthe loss of lamp life or the energy used by the lamp for each of theplurality of selectable first time delays.
 41. The sensor of claim 39further comprising a push button and a light emitting diode wherein, inresponse to actuation of the push button, the microcontroller isoperative to communicate via activation of the light emitting diode atleast one of the loss of lamp life or the energy used by the lamp forany one of the plurality of selectable first time delays.
 42. The sensorof claim 39 further comprising a push button wherein, in response toactuation of the push button, the microcontroller is operative to clearstored data pertaining to at least one of the loss of lamp life or theenergy used by the lamp for any one of the plurality of selectable firsttime delays.
 43. The sensor of claim 39 wherein the microcontroller isoperative to select a time delay from among the plurality of selectablefirst time delays based on at least one of the loss of lamp life or theenergy used by the lamp.
 44. The sensor of claim 43 wherein the timedelay selected by the microcontroller is limited to a minimum andmaximum value programmable by a user.
 45. The sensor of claim 43 whereinthe first timer is automatically set by the microcontroller to the timedelay selected by the microcontroller.
 46. The sensor of claim 43wherein after the time delay is selected by the microcontroller, thedata pertaining to at least one of the loss of lamp life or the energyused by the lamp is cleared.
 47. The sensor of claim 43 wherein afterthe time delay is selected by the microcontroller, the data pertainingto at least one of the loss of lamp life or the energy used by the lampis maintained and used in subsequent selections of a time delay by themicrocontroller.
 48. The sensor of claim 39 further comprising a secondtimer set to a second time delay, the second timer operative to activateupon the lamp turning on and deactivate upon expiration of the secondtime delay, the second timer operative to prevent the sensor fromturning off the lamp upon activation of the second timer and for theduration of the second time delay regardless of whether or not occupancyis sensed by the sensor during the duration of the second time delay.49. A lighting control system for controlling the on/off state of alamp, the system comprising: the occupancy sensor of claim 39; alighting unit comprising a fluorescent lamp; a relay coupled to thelighting unit and to a source of line voltage, the relay operative tocouple and decouple line voltage to the lighting unit; and a powersupply coupled to a source of line voltage operative to supply power tothe occupancy sensor and the relay.
 50. The sensor of claim 39 furthercomprising a passive infrared sensing technology for sensing occupancy.51. The sensor of claim 39 further comprising an integral relay forconnecting and disconnecting power to the lamp.
 52. The sensor of claim39 further comprising a display device coupled to the sensor operativeto display information for any one of the plurality of selectable firsttime delays pertaining to at least one of the loss of lamp life, theenergy used by the lamp, or the selected first time delay.
 53. A methodof using an occupancy sensor to automatically determine at least one ofthe loss of lamp life or amount of energy used by a lamp whose on/offstate is controlled by the occupancy sensor, the method comprising: (a)the sensor sensing occupancy and causing the lamp to turn on; (b) thesensor determining a first loss of lamp life caused by the lamp turningon; (c) the sensor sensing no occupancy; (d) the sensor activating atimer in response to sensing no occupancy, the timer set to a first timedelay; (e) the sensor causing the lamp to turn off upon expiration ofthe first time delay and no occupancy being sensed during the first timedelay; and (f) the sensor determining a second loss of lamp life causedby the lamp being on; and (g) the sensor summing the first and secondlosses of lamp life to determine a total loss of lamp life.
 54. Themethod of claim 53 further comprising: repeating (a) through (g) atleast once; and the sensor summing the total loss of lamp life with thepreviously determined total loss of lamp life to determine a cumulativeloss of lamp life.
 55. The method of claim 54 further comprisingcommunicating the cumulative loss of lamp life to a user via a displaydevice or via activation of a light emitting diode of the occupancysensor in response to actuation of a push button of the occupancysensor.
 56. The method of claim 53 further comprising: the sensorsimulating (a) through (g) concurrently for a plurality of selectablefirst time delays as if the timer were respectively set to each of theselectable first time delays; repeating the simulating of (a) through(g) at least once; and the sensor summing the total loss of lamp lifewith the previously determined total loss of lamp life to determine acumulative loss of lamp life for each of the plurality of selectablefirst time delays.
 57. The method of claim 56 further comprising thesensor automatically selecting a time delay having the lowest cumulativeloss of lamp life from among the plurality of selectable first timedelays.
 58. The method of claim 57 further comprising the sensorautomatically setting the timer to the selected first time delay. 59.The method of claim 53 further comprising the sensor determining theenergy used by the lamp being on.
 60. The method of claim 59 furthercomprising the sensor calculating the cost of the energy used by thelamp being on and converting the cost to an equivalent loss of lamplife.
 61. The method of claim 59 further comprising: repeating at leastonce (a) through (g) and the sensor determining the energy used by thelamp being on; and the sensor summing at least one of the total loss oflamp life with the previously determined total loss of lamp life todetermine a cumulative loss of lamp life or the energy used by the lampwith the previously determined energy used to determine a cumulativeamount of energy used by the lamp.
 62. The method of claim 61 furthercomprising communicating at least one of the cumulative loss of lamplife or cumulative amount of energy used to a user via a display deviceor via activation of a light emitting diode of the occupancy sensor inresponse to actuation of a push button of the occupancy sensor.
 63. Themethod of claim 59 further comprising: the sensor simulating (a) through(g) and the determining of energy used for each of a plurality ofselectable first time delays as if the timer were respectively set toeach of the selectable first time delays; repeating at least once thesimulating of (a) through (g) and the determining of energy used foreach of a plurality of selectable first time delays; and the sensorsumming at least one of: the total loss of lamp life with the previouslydetermined total loss of lamp life to determine a cumulative loss oflamp life for each of the plurality of selectable first time delays, orthe energy used by the lamp with the previously determined energy usedby the lamp to determine a cumulative amount of energy used by the lampfor each of the plurality of selectable first time delays.
 64. Themethod of claim 63 further comprising the sensor calculating the cost ofthe cumulative amount of energy used by the lamp and converting the costto an equivalent loss of lamp life for each of the plurality ofselectable time delays.
 65. The method of claim 64 further comprisingselecting a time delay having the lowest total loss combination of thecumulative loss of lamp life and equivalent loss of lamp life fromenergy usage from among the plurality of selectable first time delays.66. The method of claim 65 further comprising the sensor automaticallysetting the timer to the selected first time delay.
 67. A method ofcontrolling the on/off state of a lamp with an occupancy sensor toextend lamp life of the lamp, the method comprising: preventing thesensor from turning off the lamp upon activation of a first timer andfor the duration of a first time delay regardless of whether or notoccupancy is sensed by the sensor during the duration of the first timedelay the first timer set to the first time delay, the first timeroperative to activate upon the lamp turning on and to deactivate uponexpiration of the first time delay; and preventing the sensor fromturning off the lamp upon activation of a second timer and for theduration of a second time delay, the second timer automaticallyprogrammed by the sensor to the second time delay, the second timeroperative to activate upon the sensor first detecting vacancy afteroccupancy had been detected and to deactivate upon expiration of thesecond time delay or the sensor sensing occupancy, whichever occursfirst.
 68. The method of claim 67 further comprising preventing thesensor from turning off the lamp upon activation of the second timer andfor duration of the longer of the second time delay or a third timedelay, the third time delay measured from the activation of the secondtimer.
 69. The method of claim 67 further comprising preventing thesensor from turning off the lamp upon activation of the second timer andfor duration of the shorter of the second time delay or a fourth timedelay, the fourth time delay measured from the activation of the secondtimer.
 70. The method of claim 67 further comprising: activating a thirdtimer upon the lamp turning on; and terminating the third timer upon thelamp turning off.
 71. The method of claim 70 further comprising trackingthe amount of time the lamp is on by using at least one value from thethird timer.
 72. The method of claim 71 further comprising communicatingthe amount of time the lamp has been on by activating a light emittingdiode of the occupancy sensor in response to actuation of a push buttonof the occupancy sensor.
 73. The method of claim 67 further comprisingexecuting firmware or software to calculate loss of lamp life based onactual lamp usage as controlled by the sensor.
 74. The method of claim73 further comprising selecting an optimal value from among a pluralityof selectable values for the second time delay based on the calculatedloss of lamp life.
 75. The method of claim 73 further comprisingcommunicating the calculated loss of lamp life by activating a lightemitting diode of the occupancy sensor in response to actuation of apush button of the occupancy sensor.
 76. The method of claim 67 furthercomprising counting the number of times the lamp turns on.
 77. Themethod of claim 76 further comprising communicating the number of timesthe lamp has turned on by activating a light emitting diode of theoccupancy sensor in response to actuation of a push button of theoccupancy sensor.
 78. An occupancy sensor that controls the on/off stateof a lamp, the sensor comprising: a first timer set to a first timedelay, the first timer operative to activate upon the lamp turning onand deactivate upon expiration of the first time delay, the first timeroperative to prevent the sensor from turning off the lamp uponactivation of the first timer and for the duration of the first timedelay regardless of whether or not occupancy is sensed by the sensorduring the duration of the first time delay; and a second timer set to asecond time delay, the second timer operative to activate upon thesensor first detecting vacancy after occupancy had been detected and todeactivate upon expiration of the second time delay or the sensorsensing occupancy, whichever occurs first, the second timer operative toprevent the sensor from turning off the lamp upon activation of thesecond timer and for the duration of the second time delay.
 79. Thesensor of claim 78 wherein the second timer is automaticallyprogrammable by the sensor to another second time delay.
 80. The sensorof claim 78 further comprising a third time delay, the second timeroperative to prevent the sensor from turning off the lamp uponactivation of the second timer and for the duration of the longer of thesecond or third time delays, the third time delay measured from theactivation of the second timer.
 81. The sensor of claim 78 furthercomprising a fourth time delay, the second timer operative to preventthe sensor from turning off the lamp upon activation of the second timerand for the duration of the shorter of the second or fourth time delays,the fourth time delay measured from the activation of the second timer.82. The sensor of claim 78 further comprising a third timer operative toactivate upon the lamp turning on and to deactivate upon the lampturning off.
 83. The sensor of claim 78 further comprising amicrocontroller operative to execute firmware or software thatcalculates loss of lamp life based on actual lamp usage as controlled bythe sensor.
 84. The sensor of claim 83 wherein the microcontroller isoperative to select an optimal value from among a plurality ofselectable values for the second time delay based on the calculated lossof lamp life.
 85. The sensor of claim 83 further comprising apush-button and a light emitting diode and wherein the microcontrolleris operative to communicate the calculated loss of lamp life viaactivation of the light emitting diode in response to actuation of thepush button.
 86. The sensor of claim 83 further comprising a push-buttonand a light emitting diode and wherein the microcontroller is operativeto count the number of times the lamp turns on and to communicate thenumber of times the lamp has turned on via activation of the lightemitting diode in response to actuation of the push button.
 87. Thesensor of claim 83 further comprising a push-button and a light emittingdiode and wherein the microcontroller is operative to track the amountof time the lamp is on and to communicate the amount of time the lamphas been on via activation of the light emitting diode in response toactuation of the push button.
 88. The sensor of claim 83 furthercomprising a push-button and a light emitting diode and wherein themicrocontroller is operative to (1) count the number of times the lampturns on, (2) track the amount of time the lamp is on, and (3) storedata pertaining to at least one of the amount of time the lamp is on,the number of times the lamp turns on, or the calculated loss of lamplife, the microcontroller further operative to clear stored data inresponse to actuation of the push button.
 89. A method of controllingthe on/off state of a fluorescent lamp with an occupancy sensor toextend lamp life of the lamp, the method comprising: the sensor turningon the fluorescent lamp in response to detecting occupancy; the sensorkeeping the fluorescent lamp on for a first period of time in responseto first detecting vacancy after detecting occupancy; the sensor turningoff the fluorescent lamp in response to detecting vacancy for longerthan the first period of time; and the sensor automatically selecting avalue for the first period of time based on the sensor turning thefluorescent lamp on and off over a second period of time.
 90. The methodof claim 89 wherein the second period of time is about two weeks. 91.The method of claim 89 further comprising after the sensor turns on thefluorescent lamp the sensor keeping the fluorescent lamp on for a thirdperiod of time regardless of the length of the first period of time. 92.A method of controlling the on/off state of a fluorescent lamp with anoccupancy sensor to extend lamp life of the lamp, the method comprising:the sensor turning on the fluorescent lamp in response to detectingoccupancy; the sensor keeping the fluorescent lamp on for a first periodof time in response to first detecting vacancy after detectingoccupancy; the sensor turning off the fluorescent lamp in response todetecting vacancy for longer than the first period of time; and thesensor automatically calculating a loss of lamp life based on the sensorturning the fluorescent lamp on and off over a second period of time.93. The method of claim 92 further comprising the sensor automaticallyselecting a value for the first period of time from among a plurality ofselectable values available in the occupancy sensor in response to thesensor calculating the loss of lamp life.
 94. The method of claim 92further comprising the sensor communicating the loss of lamp life to auser in response to an inquiry from the user.
 95. A method of using anoccupancy sensor to automatically determine the amount of time a lamp ison, the on/off state of the lamp controlled by the occupancy sensor, themethod comprising: (a) the sensor sensing occupancy and causing the lampto turn on; (b) the sensor activating a first timer in response to thelamp turning on; (c) the sensor sensing no occupancy; (d) the sensoractivating a second timer in response to sensing no occupancy, thesecond timer set to a first time delay; (e) the sensor causing the lampto turn off and the second timer to deactivate upon expiration of thefirst time delay and no occupancy being sensed during the first timedelay; (f) the sensor deactivating the first timer in response to thelamp turning off; and (g) the sensor determining the amount of time thelamp is on using a value in the first timer.
 96. The method of claim 95further comprising: repeating (a) through (g) at least once; the sensorsumming the amount of time the lamp is on with the previously determinedamount of time the lamp is on to determine a cumulative amount of timethe lamp is on; and the sensor incrementing a counter each time (a) isrepeated to determine a cumulative number of starts.
 97. The method ofclaim 96 further comprising communicating to a user at least one of thecumulative amount of time the lamp is on or the cumulative number ofstarts via a display device or via activation of a light emitting diodeof the occupancy sensor.
 98. The method of claim 96 further comprisingtransmitting to a gateway or computer at least one of the amount of timethe lamp is on, the cumulative amount of time the lamp is on, or thecumulative number of starts.
 99. The method of claim 98 furthercomprising the gateway or computer calculating a loss of lamp life orenergy used by the lamp based on at least one of the amount of time thelamp is on, the cumulative amount of time the lamp is on, or thecumulative number of starts.
 100. The method of claim 95 furthercomprising: a gateway or computer coupled to the sensor simulating (a)through (g) concurrently for a plurality of selectable time delays as ifthe second timer were respectively set to each of the selectable timedelays; the gateway or computer repeating the simulating of (a) through(g) at least once; and the gateway or computer summing the total amountof time the lamp would have been on with the previously determined totalamount of time the lamp would have been on to determine a cumulativeamount of time the lamp would have been on for each of the plurality ofselectable time delays; and the gateway or computer incrementing acounter for each time (a) is simulated to determine a cumulative numberof starts for each of the plurality of selectable time delays.
 101. Themethod of claim 100 further comprising: the gateway or computercalculating a cumulative loss of lamp life for each of the plurality ofselectable time delays based on the cumulative amount of time the lampwould have been on and the cumulative number of starts for each of theplurality of selectable time delays; the gateway or computerautomatically selecting a time delay having the lowest cumulative lossof lamp life from among the plurality of selectable time delays; and thegateway or computer automatically setting the second timer to theselected time delay.
 102. The method of claim 95 further comprising: thesensor simulating (a) through (g) concurrently for a plurality ofselectable time delays as if the second timer were respectively set toeach of the selectable time delays; the sensor repeating the simulatingof (a) through (g) at least once; and the sensor summing the totalamount of time the lamp would have been on with the previouslydetermined total amount of time the lamp would have been on to determinea cumulative amount of time the lamp would have been on for each of theplurality of selectable time delays; and the sensor incrementing acounter for each time (a) is simulated to determine a cumulative numberof starts for each of the plurality of selectable time delays.
 103. Themethod of claim 102 further comprising the sensor calculating acumulative loss of lamp life for each of the plurality of selectabletime delays based on the cumulative amount of time the lamp would havebeen on and the cumulative number of starts for each of the plurality ofselectable time delays.
 104. The method of claim 103 further comprisingthe sensor automatically selecting a time delay having the lowestcumulative loss of lamp life from among the plurality of selectable timedelays.
 105. The method of claim 104 further comprising the sensorautomatically setting the second timer to the selected time delay. 106.A lighting control system for controlling the on/off state of a lamp,the system comprising: an occupancy sensor comprising: a counteroperative to count the number of times the lamp turns on; a first timeroperative to activate upon the lamp turning on and deactivate upon thelamp turning off; a register operative to store a cumulative amount oftime the lamp is on as timed by the first timer; and a transceiveroperative to transmit data representing the number of times the lampturns on and the cumulative amount of time the lamp is on; a lightingunit comprising a fluorescent lamp coupled to either: a relay coupled tothe occupancy sensor and to a source of line voltage, the relayoperative to couple and decouple line voltage to and from the lightingunit; or the occupancy sensor, the occupancy sensor further comprisingan integral relay, the integral relay coupled to a source of linevoltage and operative to couple and decouple the line voltage to andfrom the lighting unit; and a gateway or computer coupled to theoccupancy sensor and operative to execute firmware or software thatcalculates at least one of a loss of lamp life or energy used by thelamp based on data received from the occupancy sensor.
 107. The systemof claim 106 wherein: the occupancy sensor further comprises a secondtimer set to a first time delay, the second timer operative to activateupon the sensor detecting vacancy after occupancy had been detected andto deactivate upon expiration of the first time delay, the second timeroperative to prevent the sensor from turning off the lamp uponactivation of the second timer and for the duration of the first timedelay; and the gateway or computer is further operative to executefirmware or software that automatically sets the second timer to asecond time delay that extends lamp life based on at least one of actualor simulated loss of lamp life calculations.
 108. The system of claim106 wherein: the occupancy sensor further comprises a second timer setto a time delay, the second timer operative to activate upon the sensordetecting vacancy after occupancy had been detected and to deactivateupon expiration of the time delay, the second timer operative to preventthe sensor from turning off the lamp upon activation of the second timerand for the duration of the time delay; and the gateway or computer isfurther operative to execute firmware or software that simulates aneffect of each of a plurality of selectable time delays for the secondtimer on the operation of the lamp by the sensor and determines thenumber of times the lamp would turn on and the cumulative amount of timethe lamp would be on for each of the plurality of selectable timedelays.
 109. The system of claim 108 wherein the gateway or computer isoperative to calculate a loss of lamp life or energy used by the lampfor each of the plurality of selectable time delays based on thesimulated effect of each of the plurality of selectable time delays.110. The system of claim 109 wherein the gateway or computer isoperative to select a time delay from among the plurality of selectabletime delays based on at least one of the loss of lamp life or the energyused by the lamp calculated for each of the plurality of selectable timedelays.
 111. The system of claim 110 wherein the second timer isautomatically set by the gateway or computer to the time delay selectedby the gateway or computer.
 112. The system of claim 106 wherein thecomputer is a server, a personal computer, a laptop computer, or ahandheld computer device.